<?php
namespace app\bis\controller;
use think\Controller;
class Base extends Controller{
    //基类判断用户是否登陆
    public $account;
    public function _initialize() {
       $islogin=$this->isLogin();
       if(!$islogin){
           $this->redirect(url("login/index"));
       }
    }
  
    //判断是否登陆
    public function isLogin(){
        $user=$this->getLoginUser();
        if($user && $user->id){
            return true;
        }
        return false;
    }
    //获取登陆用户相关数据
    public function getLoginUser(){
        if(!$this->account){
         $this->account=session("bisAccount","","bis");
         }
        return $this->account;
    }
}

